<include file="Public/header" />
<title>管理员列表</title>
<style>
	.formleft input{
		margin-bottom:5px;
	}
</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单管理 (<{:get_warehousename(I('warehouse_code'))}>)
		<empty name="owner_status">
			<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;货主列表：</span>
			<foreach name="u_list" item="vo">
				<span>
					<a href="__MODULE__/Order/order/warehouse_code/<{:I('warehouse_code')}>/username/<{$vo.username}>/abnormal/<{:I('abnormal')}>" <if condition="$username eq $vo['username']">style="color:red" </if> ><{$vo.company}></a>
				</span>
			</foreach>
		</empty>
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
	
<div class="pd-20" style="margin-top:-20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<form class="formleft" name="" id="" action="__URL__/order/" method="get">
			<input type="hidden" value="<{$_GET['warehouse_code']}>" name="warehouse_code">
			<input type="hidden" value="<{:I('abnormal')}>" name="abnormal">
			<empty name="owner_status">
				<input type="hidden" value="<{$username}>" name="username">
			</empty>
			添加时间:
			<input type="input-text" name="start_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="start_time" class="input-text Wdate" style="width:200px;" value="<{:I('start_time')}>"  placeholder="开始时间"> -
			<input type="input-text" name="end_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="end_time" class="input-text Wdate" style="width:200px;"  value="<{:I('end_time')}>"    placeholder="结束时间">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['order_no']}>" placeholder="订单编号" name="order_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['logistics_no']}>" placeholder="运单号" name="logistics_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_name']}>" placeholder="收件人姓名" name="user_name">
			<img src="__PUBLIC__/img/flag/flag_green.png">
			<input type="radio" name="flag" value="1" checked="">
			<img src="__PUBLIC__/img/flag/flag_yellow.png"></img>
			<input type="radio" name="flag" value="2">
			<img src="__PUBLIC__/img/flag/flag_red.png">
			<input type="radio" name="flag" value="3">
			OMS删单<input type="checkbox" name="oms_del" value='1' <if condition="I('oms_del') eq 1">checked</if> >
			<br>
			出库时间:
			<input type="input-text" name="delivery_start_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="delivery_start_time" class="input-text Wdate" style="width:200px;" value="<{:I('delivery_start_time')}>"  placeholder="开始时间"> -
			<input type="input-text" name="delivery_end_time" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="delivery_end_time" class="input-text Wdate" style="width:200px;"  value="<{:I('delivery_end_time')}>"    placeholder="结束时间">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_idcard']}>" placeholder="身份证号" name="user_idcard">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_phone']}>" placeholder="收件人电话" name="user_phone">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['user_address']}>" placeholder="收件人地址" name="user_address">
			已推送<input type="radio" name="push_status" <if condition="I('push_status') eq 1">checked</if> value="1">
			未推送<input type="radio" name="push_status" <if condition="I('push_status') eq -1">checked</if> value="-1">
			正在推送<input type="radio" name="push_status" <if condition="I('push_status') eq 2">checked</if> value="2">
			<br>
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
			<if condition="I('abnormal') neq 1">
			<!-- <notempty name="owner_status"> -->
				<!-- <a href="javascript:;" onclick="admin_open('添加','__URL__/add_orderdetail/warehouse_code/<{:I('warehouse_code')}>/manua_id/<{:I('manua_id')}>',0,'1200','580')" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加</a> -->
			<!-- <else /> -->
				<!-- <a href="javascript:;" onclick="admin_open('添加','__URL__/add_orderdetail/warehouse_code/<{:I('warehouse_code')}>/username/<{$username}>',0,'1200','580')" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加</a> -->
			<!-- </notempty> -->

			<if condition="session('company.username') eq '18001234567' ">
			<!-- 海宁 -->
				<a href="javascript:;" onclick="importexcelAll(<{:I('warehouse_code')}>)" class="btn btn-primary radius">批量导入</a>
			</if>
			
			<if condition="session('company.username') eq '17020170728' ">
			<!-- 海宁马淘淘 -->
				<a href="javascript:;" onclick="importexcelAll(<{:I('warehouse_code')}>)" class="btn btn-primary radius">批量导入</a>
			</if>
			
			<if condition="session('company.username') eq '13918789546' ">
			<!-- 欧客 -->
				<a href="javascript:;" onclick="importexcelAll(<{:I('warehouse_code')}>)" class="btn btn-primary radius">批量导入</a>
			</if>
			
			<!-- <empty name="owner_status"> -->
				<!-- <a href="javascript:;" onclick="importexcelAll_All(<{:I('warehouse_code')}>)" class="btn btn-primary radius">全部导入</a> -->
			<!-- </empty> -->
			<a href="javascript:;" onclick="exportExcel()" class="btn btn-primary radius">批量导出</a>
			<a href="javascript:;" onclick="push()" class="btn btn-primary radius">推送</a>
			<a href="javascript:;" onclick="pushall()" class="btn btn-primary radius">全部推送</a>
			</if>
			<a href="javascript:;" onclick="pushtwo()" class="btn btn-primary radius">再次申报</a>
			<a href="javascript:;" onclick="edit_buyer()" class="btn btn-primary radius">编辑购买人</a>
			<a href="javascript:;" onclick="edit_price()" class="btn btn-primary radius">编辑价格</a>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="23">订单列表</th>
			</tr>
			<tr class="text-c">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name="" value=""></th>
				<th>序号</th>
				<th width="">原订单编号</th>
				<th width="">运单号</th>
				<th width="">包裹重量</th>
				<th width="">收件人姓名</th>
				<th width="">身份证号</th>
				<th width="">收件人电话</th>
				<!-- <th width="">收件人地址</th> -->
				<if condition="$warehouse_cate eq 2">
					<!-- <th width="">申报单号</th> -->
					<th width="">是否放行</th>
				</if>
				<th width="">发货状态</th>
				<if condition="$warehouse_cate eq 2">
					<th width="">申报失败原因</th>
				</if>
				<!-- <th width="">运输方式</th> -->
				<!-- <th width="">备注</th> -->
				<if condition="$warehouse_cate eq 1">
					<th width="">WMS备注</th>
				</if>
				<!-- <th width="">状态</th> -->
				<th width="">推送状态</th>
				<!-- <th width="">删单状态</th> -->
				<th width="">添加时间</th>
				<!-- <th width="">出库时间</th> -->
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" value="<{$vo.id}>" name="" class="ids"></td>
				<td><{$i}></td>
				<td><{$vo.old_order_no}></td>
				<td><{$vo.logistics_no}></td>
				<td>
				<if condition="$vo.actual_weight neq '0.0000'">
					<{$vo.actual_weight}>
				</if>
				</td>
				<td><{$vo.user_name}></td>
				<td>
				<if condition="$vo['buyer_idcard'] eq ''">
					<{$vo.user_idcard}>
				<else />
					<{$vo.buyer_idcard}>
				</if>
				</td>
				<td><{$vo.user_phone}></td>
				<!-- <td><{$vo.province}><{$vo.city}><{$vo.area}><{$vo.user_address}></td> -->
				<if condition="$warehouse_cate eq 2">
					<!-- <td><{$vo.apply_order_no}></td> -->
					<td>
						<if condition="$vo['is_pass'] heq NULL and $vo['push_status'] eq '1' ">
							<if condition="$vo['is_pass'] heq NULL and $vo['push_status'] eq '1' and $vo['pushtwo_status'] eq 1">
								<span style="background:red;color:white;padding:0 2px;">再次申报中</span>
							<else />
								<span style="background:red;color:white;padding:0 2px;">申报中</span>
							</if>
							
						</if>
						
						<if condition="$vo['is_pass'] heq '0'">
							<span style="background:green;color:white;padding:0 2px;">未放行</span>
						</if>
						<if condition="$vo['is_pass'] heq '2'">
							<span style="background:green;color:white;padding:0 2px;">打包中</span>
						</if>
						<if condition="$vo['is_pass'] heq '1'">
							已出库
						</if>
					</td>
				</if>
				<td>
					<if condition="$vo['is_delivery'] eq 0">
						未发货
					</if>
					<if condition="$vo['is_delivery'] eq 1">
						已发货
					</if>
				</td>
				<if condition="$warehouse_cate eq 2">
					<td>
						<if condition="$vo['is_pass'] heq '0'">
							<{$vo.fail_reason}>
						</if>
					</td>
				</if>
				<!-- <td> -->
					<!-- <if condition="$vo.transport_cate eq 0"> -->
						<!-- 正常 -->
					<!-- </if> -->
					<!-- <if condition="$vo.transport_cate eq 1"> -->
						<!-- 自提 -->
					<!-- </if> -->
					<!-- <if condition="$vo.transport_cate eq 2"> -->
						<!-- 快运 -->
					<!-- </if> -->
				<!-- </td> -->
				<!-- <td> -->
					<!-- <{$vo.erp_mark_mailno}> -->
				<!-- </td> -->
				<if condition="$warehouse_cate eq 1">
				<td>
					<{$vo.mark_mailno}>
				</td>
				</if>
				<!-- <td> -->
				<!-- <if condition="$vo.flag eq 1"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_green.png"> -->
				<!-- </if> -->
				<!-- <if condition="$vo.flag eq 2"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_yellow.png"> -->
					
				<!-- </if> -->
				<!-- <if condition="$vo.flag eq 3"> -->
					<!-- <img src="__PUBLIC__/img/flag/flag_red.png"> -->
				<!-- </if> -->
				<!-- </td> -->
				<td>
				<if condition="$vo.push_status eq 2">
					<span style="background:red;color:white;padding:0 2px;">正在推送</span>
				</if>
				<if condition="$vo.push_status eq 1">
					已推送
				</if>
				<if condition="$vo.push_status eq 0">
					<span style="background:green;color:white;padding:0 2px;">未推送</span>
				</if>
				<br>
				<if condition="$vo.cron_push_error neq '订单重复'">
					<{$vo.cron_push_error}>
				</if>
				</td>
				<!-- <td> -->
				<!-- <if condition="$vo.status eq -1"> -->
					<!-- <span style="color:red">已删除</span> -->
				<!-- </if> -->
				<!-- <if condition="$vo.status eq 4"> -->
					<!-- <span style="color:red">等待回执</span> -->
				<!-- </if> -->
				<!-- </td> -->
				<td><{$vo.add_time|date="Y-m-d H:i:s",###}></td>
				<!-- <td> -->
				<!-- <notempty name="vo.delivery_time"> -->
					<!-- <{$vo.delivery_time|date="Y-m-d H:i:s",###}> -->
				<!-- </notempty> -->
				<!-- </td> -->
				<td>
				<empty name="owner_status">
					<a href="javascript:;" onclick="admin_open('详细','__URL__/order_detail/id/<{$vo.id}>/warehouse_code/<{:I('warehouse_code')}>/username/<{$username}>','<{$vo.id}>','1200','680')" class="">详细</a>
					<a href="javascript:;" onclick="admin_open('编辑','__URL__/edit_order/id/<{$vo.id}>/warehouse_code/<{:I('warehouse_code')}>/username/<{$username}>','<{$vo.id}>','800','480')" class="">编辑</a>
					<a title="删除" href="javascript:;" onclick="del_order(<{:I('warehouse_code')}>,<{$vo.id}>,<{:I('username')}>)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
				<else />
					<a href="javascript:;" onclick="admin_open('详细','__URL__/order_detail/id/<{$vo.id}>/warehouse_code/<{:I('warehouse_code')}>','<{$vo.id}>','1200','680')" class="">详细</a>
					<a href="javascript:;" onclick="admin_open('编辑','__URL__/edit_order/id/<{$vo.id}>/warehouse_code/<{:I('warehouse_code')}>','<{$vo.id}>','800','480')" class="">编辑</a>
					<a title="删除" href="javascript:;" onclick="del_order(<{:I('warehouse_code')}>,<{$vo.id}>)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
				</empty>
				
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	function del_order(warehouse_code,id,username=0){
		url="<{:U('del_order')}>";
		layer.confirm('确认要删除吗？',function(index){
			$.ajax({ 
				url:url,
				type:"POST",			
				data:{warehouse_code:warehouse_code,id:id,username:username},
				success:function(result){
					if(result=='y'){
						layer.msg('已删除!',{icon:1,time:1000});
						setTimeout(function(){
							self.location.href=self.document.location.href;
						},1000)
						
					}else{
						layer.msg(result,{icon:1,time:1000});
					}									
				} 
			});
		});
	}
	function importexcelAll(warehouse_code){
		<empty name="owner_status">
			username="<{$username}>";
			url='__MODULE__/import/importPushorder/username/'+username+'/warehouse_code/'+warehouse_code+'/'+Math.random(); //iframe的url
		<else />
			url='__MODULE__/import/importPushorder/warehouse_code/'+warehouse_code+'/'+Math.random(); //iframe的url
		</empty>
		
        var index=layer.open({
            type: 2,
            title: '导入数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '300px'],
            content: url
        });
    }
	function importexcelAll_All(warehouse_code){
		<empty name="owner_status">
			url='__MODULE__/import/importPushorder/All/All/warehouse_code/'+warehouse_code; //iframe的url
		</empty>
		
        var index=layer.open({
            type: 2,
            title: '导入全部数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '300px'],
            content: url
        });
    }
	function exportExcel(){
		var url="<{:U('Order/order',array('order_excel'=>1))}>/?1=1";
		<empty name="owner_status">
			username="<{$username}>";
			url=url+"&username="+username;
		</empty>

		logistics_no=$('input[name=logistics_no]').val();
		order_no=$('input[name=order_no]').val();
		user_name=$('input[name=user_name]').val();
		user_idcard=$('input[name=user_idcard]').val();
		user_phone=$('input[name=user_phone]').val();
		user_address=$('input[name=user_address]').val();
		
		start_time=$('input[name=start_time]').val();
		end_time=$('input[name=end_time]').val();
		
		delivery_start_time=$('input[name=delivery_start_time]').val();
		delivery_end_time=$('input[name=delivery_end_time]').val();
		if($("input[name=oms_del]").eq(0).prop("checked")){
			oms_del=1;
			url=url+"&oms_del=1";
		}											 

		if(logistics_no!=""){
			url=url+"&logistics_no="+logistics_no;
		}
		if(order_no!=""){
			url=url+"&order_no="+order_no;
		}
		if(user_name!=""){
			url=url+"&user_name="+user_name;
		}
		if(user_idcard!=""){
			url=url+"&user_idcard="+user_idcard;
		}
		if(user_phone!=""){
			url=url+"&user_phone="+user_phone;
		}
		if(user_address!=""){
			url=url+"&user_address="+user_address;
		}
		if(start_time!=""){
			url=url+"&start_time="+start_time;
		}
		if(end_time!=""){
			url=url+"&end_time="+end_time;
		}
		if(delivery_start_time!=""){
			url=url+"&delivery_start_time="+delivery_start_time;
		}
		if(delivery_end_time!=""){
			url=url+"&delivery_end_time="+delivery_end_time;
		}
		
		var index=layer.open({
            type: 2,
            title: '导出数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '150px'],
            content: url //iframe的url
        });
	}
	function exportExcel_bak(){
		var url="<{:U('Order/order',array('excel'=>1))}>/?1=1";
		<empty name="owner_status">
			username="<{$username}>";
			url=url+"&username="+username;
		</empty>
		
		
		page=$('input[name=page]').val();
		logistics_no=$('input[name=logistics_no]').val();
		order_no=$('input[name=order_no]').val();
		user_name=$('input[name=user_name]').val();
		user_idcard=$('input[name=user_idcard]').val();
		user_phone=$('input[name=user_phone]').val();
		user_address=$('input[name=user_address]').val();
		
		start_time=$('input[name=start_time]').val();
		end_time=$('input[name=end_time]').val();
		
		delivery_start_time=$('input[name=delivery_start_time]').val();
		delivery_end_time=$('input[name=delivery_end_time]').val();

		if(logistics_no!=""){
			url=url+"&logistics_no="+logistics_no;
		}
		if(order_no!=""){
			url=url+"&order_no="+order_no;
		}
		if(user_name!=""){
			url=url+"&user_name="+user_name;
		}
		if(user_idcard!=""){
			url=url+"&user_idcard="+user_idcard;
		}
		if(user_phone!=""){
			url=url+"&user_phone="+user_phone;
		}
		if(user_address!=""){
			url=url+"&user_address="+user_address;
		}
		if(start_time!=""){
			url=url+"&start_time="+start_time;
		}
		if(end_time!=""){
			url=url+"&end_time="+end_time;
		}
		if(delivery_start_time!=""){
			url=url+"&delivery_start_time="+delivery_start_time;
		}
		if(delivery_end_time!=""){
			url=url+"&delivery_end_time="+delivery_end_time;
		}
		if(page!=""){
			url=url+"&page="+page;
		}else{
			url=url+"&page=1";
		}
		window.location.href=url;
	}
	
	function edit_buyer(){
		var option = $(".ids");
		<!-- console.log(option); -->
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
    	if(checked_counts>1){
			layer.msg('一次只能选择一个订单');
			return false;
		}else{
			id=$(".ids:checked").eq(0).val();
			<empty name="owner_status">
				username="<{$username}>";
				url='__MODULE__/Order/edit_buyer/username/'+username+'/id/'+id+'/'+Math.random(); //iframe的url
			<else />
				url='__MODULE__/Order/edit_buyer/id/'+id+'/'+Math.random(); //iframe的url
			</empty>

			var index=layer.open({
				type: 2,
				title: '编辑购买人',
				shadeClose: true,
				shade: 0.5,
				area: ['800px','300px'],
				content: url
			});
		}
	}

    function edit_price(){
        var option = $(".ids");
        <!-- console.log(option); -->
        var checked_counts=0;
        var check_val = [];
        for(var i=0;i<option.length;i++){
            if(option[i].checked){
                checked_counts++;
                check_val.push(option[i].value);
            }
        }
        if(checked_counts>1){
            layer.msg('一次只能选择一个订单');
            return false;
        }else{
            id=$(".ids:checked").eq(0).val();
        <empty name="owner_status">
            username="<{$username}>";
            url='__MODULE__/Order/edit_price/username/'+username+'/id/'+id+'/'+Math.random(); //iframe的url
        <else />
            url='__MODULE__/Order/edit_price/id/'+id+'/'+Math.random(); //iframe的url
        </empty>

            var index=layer.open({
                type: 2,
                title: '编辑价格',
                shadeClose: true,
                shade: 0.5,
                area: ['800px','300px'],
                content: url
            });
        }
    }
	//全部推送
	function pushall(){
		url="<{:U('pushoms_all')}>";
		<empty name="owner_status">
			username="<{$username}>";
		<else />
			username="0";
		</empty>
		$.ajax({
			type: 'POST',
			data: {warehouse_code:<{:I('warehouse_code')}>,username:username},
			url: url,
			success:function(data){
				if(data.status==1){
					layer.msg(data.message,function(){
						window.location.reload();
					});
				}else{
					layer.msg(data.message);
				}
				return false;
			}
		})
	}
	//推送
	function push(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<if condition="$importExcelPushorderTempName eq 0">
			url="<{:U('pushoms_normal')}>";	//跨境正常
		</if>
		<if condition="$importExcelPushorderTempName eq 1">
			url="<{:U('pushoms_normal_normal')}>";	//一般正常
		</if>
		<if condition="$importExcelPushorderTempName eq '3-aozhou.xlsx'">
			url="<{:U('pushoms_aozhou')}>";	//跨境定制
		</if>
		
		<empty name="owner_status">
			username="<{$username}>";
			
		<else />
			username="0";
		</empty>
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val,warehouse_code:<{:I('warehouse_code')}>,username:username},
				url: url,
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	//再次推送
	function pushtwo(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<empty name="owner_status">
			username="<{$username}>";
			
		<else />
			username="0";
		</empty>
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val,username:username},
				url: "<{:U('pushoms_two')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	function pushselect(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<empty name="owner_status">
			username="<{$username}>";
			
		<else />
			username="0";
		</empty>
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val,username:username},
				url: "<{:U('pushselect')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	//批量删除
	function delAll(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<empty name="owner_status">
			username="<{$username}>";
			
		<else />
			username="0";
		</empty>
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val,username:username},
				url: "<{:U('delAll_order')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.info,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.info);
					}
					return false;
				}
			})
		}
	}
</script>
 <include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>